//
//  SearchPoiResultModel.m
//  o_amap
//
//  Created by Q神 on 2021/4/8.
//

#import "SearchPoiResultModel.h"
#import "SearchMapPoiModel.h"

@implementation SearchPoiResultModel

+ (SearchPoiResultModel *)createPoiResultModelWithResponse:(AMapPOISearchResponse *)response {
    SearchPoiResultModel *model = [[SearchPoiResultModel alloc] init];
    model.pageCount = response.count;
    model.pois = [SearchMapPoiModel createSearchMapPoiModelWithArray:response.pois];
    model.searchSuggestionCitys = [SearchSuggestionCityModel createPoiResultModelWithCitys:response.suggestion.cities];
    model.searchSuggestionKeywords = response.suggestion.keywords;
    return model;
}

@end


//@implementation SearchSuggestionCityModel
//
//+ (NSArray<SearchSuggestionCityModel *> *)createPoiResultModelWithCitys:(NSArray<AMapCity *> *)arrays {
//    NSMutableArray<SearchSuggestionCityModel *> *models = [NSMutableArray array];
//    for (AMapCity *mapCity in arrays) {
//        SearchSuggestionCityModel *model = [[SearchSuggestionCityModel alloc] init];
//        model.cityName = mapCity.city;
//        model.cityCode = mapCity.citycode;
//        model.adCode = mapCity.adcode;
//        model.suggestionNum = mapCity.num;
//        [models addObject:model];
//    }
//    return models;
//}
//
//@end
